﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
namespace 类的继承与多态
{
      class book:product
    {
        private string isba;//书号
        private string instro;//简介
        //base表示调用指定的基类构造方法（显示）
        public book():base("无名书籍")
        {
            Debug.WriteLine("调用book无参构造函数");
        }
      
        ~book()
        {
            Debug.WriteLine("调用BOOK析构函数");
        }

        public string Isba { get { return isba; } set { isba = value; } }
        public string Instro { get { return instro; } set { instro = value; } }

        public override void showdetil()
        {
            Console.WriteLine("书籍介绍{0}",instro);
            Console.WriteLine("书籍书号{0}",isba);
           

        }
        public override void show()
        {
            base.show();   //显示调用基类被覆盖方法
            Console.WriteLine("书籍名称{0}",name);
            Console.WriteLine("书籍价格{0}",price);


        }
    }
}
